package com.ikproducts.manualian.server.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Collection;
import java.util.List;

import javax.jdo.PersistenceManager;
import javax.jdo.Query;
import javax.servlet.ServletOutputStream;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.api.datastore.Text;
import com.ikproducts.manualian.server.Article;
import com.ikproducts.manualian.server.Content;
import com.ikproducts.manualian.server.PMF;

@SuppressWarnings("serial")
public class ArticleBrowsingServlet extends HttpServlet {

	public void doGet(HttpServletRequest req, HttpServletResponse resp)	throws IOException {
		resp.setContentType("text/html; charset=UTF-8");
		PrintWriter out = resp.getWriter();
//		out.println("<head>");
		out.println("<link type=\"text/css\" rel=\"stylesheet\" href=\"../../Manualveki.css\">");
//		out.println("</head>");
		
/*		PersistenceManager pm = PMF.get().getPersistenceManager(); 
		try{
			Query query = pm.newQuery(Article.class);
			
	
			try{
				Collection<Article> articles = (Collection<Article>)query.execute();
				for(Article a : articles){
					out.println(a.get_UserName());
					List<Content> list = a.get_Contents();
					for(Content c : list){
						out.println(c.get_ContentType());	
						out.println(",");	
						out.println(c.get_Content().getValue());	
						out.println(",");	
					}
					out.println("<br />");
				}
			}
			finally{
				query.closeAll();
			}
		}
		finally{
			pm.close();
		}
	*/	
		out.println("<h1>1234567788902</h1>");
	}
}
